package huoye.shops.huoye.operation.presenter;


import huoye.shops.base.BasePresenter;
import huoye.shops.huoye.operation.networt.OperationService;
import huoye.shops.huoye.operation.view.IManageEventRefreshView;
import huoye.shops.huoye.operation.view.IUserStatisticsRefreshView;

/**
 * Created by uesr on 2017/7/19.
 */

public class UserStatisticsPresenter extends BasePresenter<IUserStatisticsRefreshView> {

  private OperationService mService;

    /*BaseJsonRequestCallback<Article> baseJsonRequestCallback = new BaseJsonRequestCallback<Article>(Article.class) {

        @Override
        public void onSuccess(List<Article> list, Paging paging) {
            super.onSuccess(list, paging);
            view.setDataSet(list, paging);
        }


        //网络请求失败
        @Override
        public void onFailure(String msg, String code, Throwable e) {
            super.onFailure(msg, code, e);
            view.makeToast(msg);
        }

        //加载失败
        @Override
        public void onNetworkFail() {
            super.onNetworkFail();
            view.onNetworkFail();
        }

        //加载结束
        @Override
        public void onFinish() {
            super.onFinish();
            view.hideProcessingIndicator();
        }

        @Override
        public GsonBuilder getGsonBuilder() {
            GsonBuilder builder = super.getGsonBuilder();
            builder.registerTypeAdapter(Boolean.class, new BooleanTypeAdapter());
            return builder;
        }
    };


    //干货列表
    public void queryArticle(Paging paging){
        mService.queryArticle(paging,baseJsonRequestCallback);
    }

    //干货收藏列表
    public void queryCollectArticle(Paging paging){
        mService.queryCollectArticle(paging,baseJsonRequestCallback);
    }*/


    @Override
    public void onStart() {
        mService = new OperationService();
    }
}
